<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>企业人事管理系统-添加公告</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../static/css/font.css">
    <link rel="stylesheet" href="../../static/css/weadmin.css">
    <script src="../../lib/layui/layui.js" charset="utf-8"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
	      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
	      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
	    <![endif]-->
    <style>
        .labelContainer{
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: flex-start;
        }
    </style>
    <script src="../../lib/layui/layui.js" charset="utf-8"></script>
    <script src="../../static/js/jquery.1.11.3.min.js"></script>
    <script src="../../static/js/eleDel.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../static/js/util/util.js"></script>
    <script>
       function init() {
           var id = JSON.parse(localStorage.getItem("user"));
           $("#id").val(id.uid);
       }
    </script>
</head>

<body onload="init()">
    <div class="weadmin-nav">
        <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">公告管理</a>
            <a>
                <cite>添加公告</cite>
            </a>
        </span>
        <a class="layui-btn layui-btn-sm" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);"
            title="刷新">
            <i class="layui-icon" style="line-height:30px">&#x1002;</i>
        </a>
    </div>
    <div class="weadmin-body">
        <form class="layui-form" id="noticeForm">
            <div class="layui-input-inline">
                <input type="hidden" id="id" name="createBy" required="" lay-verify="required" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-item">
                <label for="username" class="layui-form-label">
                    <span class="we-red">*</span>公告标题
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="username" name="title" required="" lay-verify="required" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="username" class="layui-form-label">
                    <span class="we-red">*</span>公告内容
                </label>
                <div class="layui-input-inline">
                    <textarea name="content" required lay-verify="required" placeholder="请输入" class="layui-textarea" style="width: 600px;height: 300px;"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline labelContainer">
                    <label for="username" class="layui-form-label">
                        有效时间
                    </label>
                    <input class="layui-input" style="width: 200px" placeholder="截止日" name="activeTime" id="end">
                </div>
            </div>
        </form>
        <button class="layui-btn btn-items" style="margin-left: 110px" id="add">发布</button>
    </div>

</body>
<script>
		/*layui.extend({
			admin: '{/}../../static/js/admin'
		});*/
        //各种基于事件的操作，下面会有进一步介绍
		layui.use('form', function () {
			var form = layui.form;
            $("#add").click(function () {
                post('/notice/addNotice',$("#noticeForm").serialize(),function (data) {
                   layer.msg(data);
                });
            });
		});
</script>
</html>